<?php 
$total = count($adc->getAdCats());
if($total > 1)
{
	?>
     <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#filtergrid" href="#catfiltergrid">
				<?php echo ucfirst($txt->getWord('choose').' '.$txt->getWord('category')); ?>
            </a>
        </div>
        <div id="catfiltergrid" class="accordion-body collapse <?php if($adc->getSetting('CollapseCat') == 0) { echo 'in'; } ?>">
            <div class="accordion-inner">
                <div class="row-fluid">
                    <ul class="thumbnails">
						<?php
                        $i = 1;
                        foreach($adc->getAdCats() as $cat)
                        {
                            if(($cat->getAdsCount() > 0) || ($adc->getSetting('ViewEmptyCat') > 0))
                            {
                                $link = $katana->getURL().'/adcat/'.$cat->getId().'/';
                                
                                if($adc->getCurrentAdBrandId() > 0)
                                { $link .= 'adbrand/'.$adc->getCurrentAdBrandId().'/'; }
                                
                                if(intval($_GET['bt']) > 0)
                                { $link .= '?bt='.intval($_GET['bt']); }
                                
                                echo '<li class="span2 col-md-2">';
                                if(is_object($cat->getImageObject()))
                                { 
                                    ?>
                                    <a class="thumbnail prospect-cat center" href="<?php echo $link; ?>" data-toggle="tooltip" data-original-title="<?php echo $cat->getDescription(); ?> b">
                                    <img title="<?php echo $cat->getTitle(); ?>" src="<?php echo $cat->getImageObject()->getLink($adc->getSetting('CatListW'), $adc->getSetting('CatListH')) ?>" alt="<?php echo $cat->getTitle(); ?>" />
                                    <?php 
                                    echo $txt->truncate($cat->getTitle(), 25, '', '');
                                    if($cat->getDescription())
                                    {
                                    ?>
                                    <div id="cat-id-<?php echo $cat->getId() ?>" class="caption prospect-cat-description text-left">
                                        <p><?php echo $cat->getDescription() ?></p>
                                    </div>
                                    <?php
                                    }
                                    
                                    ?>
                                    </a>
                                    <?php
                                }
                                echo '</li>';
                                
                                if(($i%6) == 0)
                                { echo '</ul></div><div class="row-fluid"><ul class="thumbnails">'; }
                                
                                $class = '';
                                $i++;
                            }
                        }
                        ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <?php
}
?>